dim ws : set ws = CreateObject("WScript.Shell")
dim varName : varName = "ApplicationMode"
dim regPath : regPath ="HKEY_CURRENT_USER\Software\MyApp\PADS\" & varName
dim varValue : varValue = ws.RegRead(regPath)

Application.StatusBarText =""
select case varValue
	case 0
		if ws.RegRead("HKEY_CURRENT_USER\Software\MyApp\PADS\IsUnion")=0 then
			Application.ExecuteCommand("Rotate 90")
			Application.StatusBarText ="Rotate Component"
		else
			Application.ExecuteCommand("Rotate Group")
			Application.StatusBarText ="Rotate Group"
		end if		
	case else
		'Application.ExecuteCommand("Rotate 90")
		'Application.StatusBarText ="Rotate Component"
end select
set ws = nothing






